home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / Developer Essentials Jul 90 / International System⁄HyperCard / KanjiTalk Toolkit / Sample Code / KeyScript / KeyScript.r < prev    next >
Encoding:
Text File  |  2002-01-01  |  6.5 KB  |  323 lines  |  [TEXT/MPS ]

  1. /*------------------------------------------------------------------------------
  2. #
  3. #    Apple Macintosh Developer Technical Support
  4. #
  5. #    ScriptManager Compatible MultiFinder-Aware TextEdit Sample Application
  6. #
  7. #    KeyScript
  8. #
  9. #    KeyScript.r    -    Rez Source
  10. #
  11. #    Copyright © 1989 Apple Computer, Inc.
  12. #    All rights reserved.
  13. #
  14. ------------------------------------------------------------------------------*/
  15.  
  16. #include "systypes.r"
  17. #include "types.r"
  18.  
  19. #include "KeyScript.h"
  20.  
  21. resource 'vers' (1) {
  22.     0x02, 0x00, release, 0x00,
  23.     verUS,
  24.     "1.02",
  25.     "1.02, Copyright \251 1989 Apple Computer, Inc."
  26. };
  27.  
  28. /* we use an MBAR resource to conveniently load all the menus */
  29.  
  30. resource 'MBAR' (rMenuBar, preload) {
  31.     { mApple, mFile, mEdit };        /* three menus */
  32. };
  33.  
  34.  
  35. resource 'MENU' (mApple, preload) {
  36.     mApple, textMenuProc,
  37.     0b1111111111111111111111111111101,    /* disable dashed line, enable About and DAs */
  38.     enabled, apple,
  39.     {
  40.         "About KeyScript\311",
  41.             noicon, nokey, nomark, plain;
  42.         "-",
  43.             noicon, nokey, nomark, plain
  44.     }
  45. };
  46.  
  47. resource 'MENU' (mFile, preload) {
  48.     mFile, textMenuProc,
  49.     0b0000000000000000000100000000000,    /* enable Quit only, program enables others */
  50.     enabled, "File",
  51.     {
  52.         "New",
  53.             noicon, "N", nomark, plain;
  54.         "Open",
  55.             noicon, "O", nomark, plain;
  56.         "-",
  57.             noicon, nokey, nomark, plain;
  58.         "Close",
  59.             noicon, "W", nomark, plain;
  60.         "Save",
  61.             noicon, "S", nomark, plain;
  62.         "Save As\311",
  63.             noicon, nokey, nomark, plain;
  64.         "Revert",
  65.             noicon, nokey, nomark, plain;
  66.         "-",
  67.             noicon, nokey, nomark, plain;
  68.         "Page Setup\311",
  69.             noicon, nokey, nomark, plain;
  70.         "Print\311",
  71.             noicon, nokey, nomark, plain;
  72.         "-",
  73.             noicon, nokey, nomark, plain;
  74.         "Quit",
  75.             noicon, "Q", nomark, plain
  76.     }
  77. };
  78.  
  79. resource 'MENU' (mEdit, preload) {
  80.     mEdit, textMenuProc,
  81.     0b0000000000000000000000000000000,    /* disable everything, program does the enabling */
  82.     enabled, "Edit",
  83.      {
  84.         "Undo",
  85.             noicon, "Z", nomark, plain;
  86.         "-",
  87.             noicon, nokey, nomark, plain;
  88.         "Cut",
  89.             noicon, "X", nomark, plain;
  90.         "Copy",
  91.             noicon, "C", nomark, plain;
  92.         "Paste",
  93.             noicon, "V", nomark, plain;
  94.         "Clear",
  95.             noicon, nokey, nomark, plain
  96.     }
  97. };
  98.  
  99.  
  100. /* this ALRT and DITL are used as an About screen */
  101.  
  102. resource 'ALRT' (rAboutAlert, purgeable) {
  103.     {40, 20, 160, 296}, rAboutAlert, {
  104.         OK, visible, silent;
  105.         OK, visible, silent;
  106.         OK, visible, silent;
  107.         OK, visible, silent
  108.     };
  109. };
  110.  
  111. resource 'DITL' (rAboutAlert, purgeable) {
  112.     { /* array DITLarray: 5 elements */
  113.         /* [1] */
  114.         {88, 184, 108, 264},
  115.         Button {
  116.             enabled,
  117.             "OK"
  118.         },
  119.         /* [2] */
  120.         {8, 8, 24, 274},
  121.         StaticText {
  122.             disabled,
  123.             "MultiFinder-Aware TextEdit Application"
  124.         },
  125.         /* [3] */
  126.         {32, 8, 48, 237},
  127.         StaticText {
  128.             disabled,
  129.             "Copyright \251 1989 Apple Computer"
  130.         },
  131.         /* [4] */
  132.         {56, 8, 72, 136},
  133.         StaticText {
  134.             disabled,
  135.             "Brought to you by:"
  136.         },
  137.         /* [5] */
  138.         {80, 24, 112, 167},
  139.         StaticText {
  140.             disabled,
  141.             "Macintosh Developer  Technical Support"
  142.         }
  143.     }
  144. };
  145.  
  146.  
  147. /* this ALRT and DITL are used as an error screen */
  148.  
  149. resource 'ALRT' (rUserAlert, purgeable) {
  150.     {40, 20, 150, 260},
  151.     rUserAlert,
  152.     { /* array: 4 elements */
  153.         /* [1] */
  154.         OK, visible, silent,
  155.         /* [2] */
  156.         OK, visible, silent,
  157.         /* [3] */
  158.         OK, visible, silent,
  159.         /* [4] */
  160.         OK, visible, silent
  161.     }
  162. };
  163.  
  164.  
  165. resource 'DITL' (rUserAlert, purgeable) {
  166.     { /* array DITLarray: 3 elements */
  167.         /* [1] */
  168.         {80, 150, 100, 230},
  169.         Button {
  170.             enabled,
  171.             "OK"
  172.         },
  173.         /* [2] */
  174.         {10, 60, 60, 230},
  175.         StaticText {
  176.             disabled,
  177.             "Error. ^0."
  178.         },
  179.         /* [3] */
  180.         {8, 8, 40, 40},
  181.         Icon {
  182.             disabled,
  183.             2
  184.         }
  185.     }
  186. };
  187.  
  188.  
  189. resource 'WIND' (rDocWindow, preload, purgeable) {
  190.     {64, 60, 314, 460},
  191.     zoomDocProc, invisible, goAway, 0x0, "untitled"
  192. };
  193.  
  194.  
  195. resource 'CNTL' (rVScroll, preload, purgeable) {
  196.     {-1, 385, 236, 401},
  197.     0, visible, 0, 0, scrollBarProc, 0, ""
  198. };
  199.  
  200.  
  201. resource 'CNTL' (rHScroll, preload, purgeable) {
  202.     {235, -1, 251, 386},
  203.     0, visible, 0, 0, scrollBarProc, 0, ""
  204. };
  205.  
  206. resource 'STR#' (kErrStrings, purgeable) {
  207.     {
  208.     "You must run on 512Ke or later";
  209.     "Application Memory Size is too small";
  210.     "Not enough memory to run KeyScript";
  211.     "Not enough memory to do Cut";
  212.     "Cannot do Cut";
  213.     "Cannot do Copy";
  214.     "Cannot exceed 32,000 characters with Paste";
  215.     "Not enough memory to do Paste";
  216.     "Cannot create window";
  217.     "Cannot exceed 32,000 characters";
  218.     "Cannot do Paste"
  219.     }
  220. };
  221.  
  222. /* here is the quintessential MultiFinder friendliness device, the SIZE resource */
  223.  
  224. resource 'SIZE' (-1) {
  225.     dontSaveScreen,
  226.     acceptSuspendResumeEvents,
  227.     enableOptionSwitch,
  228.     canBackground,                /* we can background; we don't currently, but our sleep value */
  229.                                 /* guarantees we don't hog the Mac while we are in the background */
  230.     multiFinderAware,            /* this says we do our own activate/deactivate; don't fake us out */
  231.     backgroundAndForeground,    /* this is definitely not a background-only application! */
  232.     dontGetFrontClicks,            /* change this is if you want "do first click" behavior like the Finder */
  233.     ignoreChildDiedEvents,        /* essentially, I'm not a debugger (sub-launching) */
  234.     not32BitCompatible,            /* this app should not be run in 32-bit address space */
  235.     reserved,
  236.     reserved,
  237.     reserved,
  238.     reserved,
  239.     reserved,
  240.     reserved,
  241.     reserved,
  242.     kPrefSize * 1024,
  243.     kMinSize * 1024    
  244. };
  245.  
  246.  
  247. type 'MOOT' as 'STR ';
  248.  
  249.  
  250. resource 'MOOT' (0) {
  251.     "MultiFinder-Aware TextEdit Sample Application"
  252. };
  253.  
  254.  
  255. resource 'BNDL' (128) {
  256.     'MOOT',
  257.     0,
  258.     {
  259.         'ICN#',
  260.         {
  261.             0, 128
  262.         },
  263.         'FREF',
  264.         {
  265.             0, 128
  266.         }
  267.     }
  268. };
  269.  
  270.  
  271. resource 'FREF' (128) {
  272.     'APPL',
  273.     0,
  274.     ""
  275. };
  276.  
  277.  
  278. resource 'ICN#' (128) {
  279.     { /* array: 2 elements */
  280.         /* [1] */
  281.         $"04 30 40 00 0A 50 A0 00 0B 91 10 02 08 22 08 03"
  282.         $"12 24 04 05 20 28 02 09 40 10 01 11 80 0C 00 A1"
  283.         $"80 03 FF C2 7E 00 FF 04 01 00 7F 04 03 00 1E 08"
  284.         $"04 E0 00 0C 08 E0 00 0A 10 E0 00 09 08 C0 00 06"
  285.         $"04 87 FE 04 02 88 01 04 01 88 00 84 00 88 00 44"
  286.         $"00 88 00 44 00 88 00 C4 01 10 01 88 02 28 03 10"
  287.         $"01 C4 04 E0 00 02 08 00 73 BF FB EE 4C A2 8A 2A"
  288.         $"40 AA AA EA 52 AA AA 24 5E A2 8A EA 73 BE FB 8E",
  289.         /* [2] */
  290.         $"04 30 40 00 0E 70 E0 00 0F F1 F0 02 0F E3 F8 03"
  291.         $"1F E7 FC 07 3F EF FE 0F 7F FF FF 1F FF FF FF BF"
  292.         $"FF FF FF FE 7F FF FF FC 01 FF FF FC 03 FF FF F8"
  293.         $"07 FF FF FC 0F FF FF FE 1F FF FF FF 0F FF FF FE"
  294.         $"07 FF FF FC 03 FF FF FC 01 FF FF FC 00 FF FF FC"
  295.         $"00 FF FF FC 00 FF FF FC 01 FF FF F8 03 EF FF F0"
  296.         $"01 C7 FC E0 00 03 F8 00 73 BF FB EE 7F BE FB EE"
  297.         $"7F BE FB EE 7F BE FB E4 7F BE FB EE 73 BE FB 8E"
  298.     }
  299. };
  300.  
  301.  
  302. resource 'DLOG' (1000, "About TubeTest…") {
  303.     {90, 50, 180, 460},
  304.     rDocProc, visible, noGoAway, 0x0, 1000, "TubeAbout"
  305. };
  306.  
  307.  
  308. resource 'DITL' (1000) {
  309.      {
  310. /* 1 */ {60, 167, 81, 244},
  311.         button {
  312.             enabled,
  313.             "OK"
  314.         };
  315. /* 2 */ {5, 10, 60, 400},                /* SourceLanguage Item */
  316.         EditText {
  317.             enabled,
  318.             ""
  319.         }
  320.     }
  321. };
  322.  
  323.